function getUrlParam(key) {
    // 对url进行解码（保证汉字不会乱码）
    const url = decodeURI(window.location.toString());
    let arr = url.split("?");

    if (arr.length > 1) {
        let params = arr[1].split("&");
        for (let i = 0; i < params.length; i++) {
            let param = params[i];
            if (param.split("=")[0] == key) {
                return param.split("=")[1];
            }
        }
    }
    return null;
}
